package numberOfPairs;

public class Solution {
    public int[] numberOfPairs(int[] nums) {
        int[] marks = new int[101];
        for (int num: nums) {
            marks[num]++;
        }
        int[] ans = new int[2];
        for (int t: marks) {
            ans[0]+=(t/2); // 可以选的整数数对的数目
        }
        ans[1] = nums.length-ans[0]*2;
        return ans;
    }
}
